<?php

/**
 * Ticketlines form base class.
 *
 * @package    tvpv
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseTicketlinesForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'ticket'     => new sfWidgetFormInputHidden(),
      'line'       => new sfWidgetFormInputHidden(),
      'product'    => new sfWidgetFormPropelChoice(array('model' => 'Products', 'add_empty' => true)),
      'units'      => new sfWidgetFormInput(),
      'price'      => new sfWidgetFormInput(),
      'taxid'      => new sfWidgetFormPropelChoice(array('model' => 'Taxes', 'add_empty' => false)),
      'attributes' => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'ticket'     => new sfValidatorPropelChoice(array('model' => 'Tickets', 'column' => 'id', 'required' => false)),
      'line'       => new sfValidatorPropelChoice(array('model' => 'Ticketlines', 'column' => 'line', 'required' => false)),
      'product'    => new sfValidatorPropelChoice(array('model' => 'Products', 'column' => 'id', 'required' => false)),
      'units'      => new sfValidatorNumber(),
      'price'      => new sfValidatorNumber(),
      'taxid'      => new sfValidatorPropelChoice(array('model' => 'Taxes', 'column' => 'id')),
      'attributes' => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('ticketlines[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Ticketlines';
  }


}
